-
-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add generate fromTemplate command #221
Conversation
@magicmatatjahu should I create local types for https://github.com/asyncapi/generator or is there a plan for adding typescript support? |
We have plan to add types asyncapi/generator#468 but as I see you added types in this project. For me it's not a problem, we can always remove them and switch to the official typing. |
src/commands/generate.ts
Outdated
default: false, | ||
description: 'force writing of the generated files to given directory even if it is a git repo with unstaged files or not empty dir (defaults to false)' | ||
}), | ||
'watch-tempalte': flags.boolean({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Souvikns Some tip: you can use https://github.com/asyncapi/cli/blob/master/src/flags.ts#L3 that flag and that https://github.com/asyncapi/cli/blob/master/src/globals.ts#L28 helper to enable watcher :)
@magicmatatjahu I need your help with this For some reason, due to generate command the CLI is throwing ts error all over the project. Currently, I am getting these warnings when I run CLI. Error Logs
These warnings are coming from here const generator = new Generator(template, flags.output || path.resolve(os.tmpdir(), 'asyncapi-generator'), {
forceWrite: flags['force-write'],
install: flags.install,
debug: flags.debug,
templateParams: params,
noOverwriteGlobs: flags['no-overwrite'],
mapBaseUrlToFolder: flags['map-base-url'],
disableHooks,
mapBaseURLToFolder
});
await generator.generateFomString(asyncapi.text()); To be precise it breaks in when I create a new |
@Souvikns I will check that but as I remember we had similar issue in the |
@magicmatatjahu why does
|
@Souvikns For transpiling TS on the fly. https://github.com/asyncapi/generator/blob/master/docs/authoring.md#typescript-support |
@magicmatatjahu I tried ignoring the import but I am getting the same errors. |
Ah yes, cause we are not using There are 2 options:
yeah it will take some time until it is actually used in the generator. @magicmatatjahu @boyney123 any thoughts on above challenges? |
@derberg I went with this and also removed the stack from the output so now the error messages look something like this The messages coming from the generator commands are self explanatory so I didn't changed anything, can you review and let me know if any thing needs to be changed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Souvikns 3 small suggestions,
in the meantime I'll do some manual testing
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Souvikns amazing work done here 👏🏼 well well done 💪🏼
@magicmatatjahu as you were involved in this PR as well in regards to watcher, let us wait for your approval before merge too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 🚀
/rtm |
🎉 This PR is included in version 0.24.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Description
This PR aims to implement generate command that will replace Generator CLI
Related issue(s)
Resolves #9